void CreateMap()
{
	setlinecolor(COLORREF RGB(11, 191, 206));
	rectangle(90, 90, 510, 610);
	rectangle(100, 100, 500, 600);
}

void HitWall()
{
	if (snake.xy[0].x > 490 || snake.xy[0].x < 100 || snake.xy[0].y > 590 || snake.xy[0].y < 100)
	{
		gameover();	
	}
}
void EatFood()
{
	if (snake.xy[0].x == Food.foodxy.x && snake.xy[0].y == Food.foodxy.y)
	{
		snake.lenth++;
		Food.grade += 10;
		Food.symbol = 0;
	}
}
void gameover()
{
	settextstyle(25, 0, "楷体");
	outtextxy(530, 200, "怎么撞到墙了");
	outtextxy(530, 225, "下次注意");
	_getch();
	GameEnd();
}
void gameover2()
{
	
	settextstyle(25, 0, "楷体");
	outtextxy(530, 200, "这么饿吗");
	outtextxy(530, 225, "连自己的身体都不放过");
	outtextxy(530, 250, "好了，把自己咬死了");
	_getch();
	GameEnd();
}
void difficult()
{
	snake.speed = 30;
	Food.grade = 0;
	setbkcolor(BLACK);
	cleardevice();
	createsnake();
	while (1)
	{
		gotoxy(0, 0);
		cleardevice();
		CreateMap();
		grade();
		drawsnake();
		drawfood();
		SnakeMove();
		speedup2();
		if (Food.symbol == 0)
		{
			CreateFood();
		}
		Sleep(snake.speed);
		HitWall();
		EatFood();
	}
	_getch();
}